home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Forms Misc / checbox-counter.izs < prev    next >
Text File  |  2005-09-28  |  3KB  |  119 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Checkbox Counter
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This script tells you in a msgbox how many of the checkboxes have been checked!<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>Forms<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13.  
  14. <!-- HOW TO INSTALL CHECKBOX COUNTER:
  15.  
  16.   1.  Copy code into the HEAD section of document
  17.   2.  Put last coding into the BODY section of document  -->
  18.  
  19. <!-- STEP ONE: Add code into HEAD section of document  -->
  20.  
  21. <HEAD>
  22.  
  23. <SCRIPT LANGUAGE="JavaScript">
  24. <!-- Original:  Alan Gruskoff (alan@performantsystems.com) -->
  25. <!-- Web Site:  http://www.performantsystems.com/ -->
  26.  
  27.  
  28. <!-- Begin
  29. function anyCheck(form) {
  30. var total = 0;
  31. var max = form.ckbox.length;
  32. for (var idx = 0; idx < max; idx++) {
  33. if (eval("document.playlist.ckbox[" + idx + "].checked") == true) {
  34.     total += 1;
  35.    }
  36. }
  37. alert("You selected " + total + " boxes.");
  38. }
  39. //  End -->
  40. </script>
  41.  
  42. </HEAD>
  43.  
  44. <!-- STEP TWO: Add code into BODY section of document  -->
  45.  
  46. <BODY>
  47.  
  48. <form method="post" name=playlist>
  49. 1<input type=checkbox name=ckbox>
  50. <br>2<input type=checkbox name=ckbox>
  51. <br>3<input type=checkbox name=ckbox>
  52. <br>4<input type=checkbox name=ckbox>
  53. <br>5<input type=checkbox name=ckbox>
  54. <br>6<input type=checkbox name=ckbox>
  55. <br>7<input type=checkbox name=ckbox>
  56. <br>8<input type=checkbox name=ckbox>
  57. <br>9<input type=checkbox name=ckbox>
  58. <p><input type=button value="Count Checkboxes" onClick="anyCheck(this.form)">
  59. </form>
  60.  
  61.  
  62. <!-- END OF SCRIPT -->
  63. <!/SCRIPT>
  64.  
  65. <!PREVIEW>
  66. <!-- START OF SCRIPT -->
  67.  
  68. <!-- HOW TO INSTALL CHECKBOX COUNTER:
  69.  
  70.   1.  Copy code into the HEAD section of document
  71.   2.  Put last coding into the BODY section of document  -->
  72.  
  73. <!-- STEP ONE: Add code into HEAD section of document  -->
  74.  
  75. <HEAD>
  76.  
  77. <SCRIPT LANGUAGE="JavaScript">
  78. <!-- Original:  Alan Gruskoff (alan@performantsystems.com) -->
  79. <!-- Web Site:  http://www.performantsystems.com/ -->
  80.  
  81.  
  82. <!-- Begin
  83. function anyCheck(form) {
  84. var total = 0;
  85. var max = form.ckbox.length;
  86. for (var idx = 0; idx < max; idx++) {
  87. if (eval("document.playlist.ckbox[" + idx + "].checked") == true) {
  88.     total += 1;
  89.    }
  90. }
  91. alert("You selected " + total + " boxes.");
  92. }
  93. //  End -->
  94. </script>
  95.  
  96. </HEAD>
  97.  
  98. <!-- STEP TWO: Add code into BODY section of document  -->
  99.  
  100. <BODY>
  101.  
  102. <form method="post" name=playlist>
  103. 1<input type=checkbox name=ckbox>
  104. <br>2<input type=checkbox name=ckbox>
  105. <br>3<input type=checkbox name=ckbox>
  106. <br>4<input type=checkbox name=ckbox>
  107. <br>5<input type=checkbox name=ckbox>
  108. <br>6<input type=checkbox name=ckbox>
  109. <br>7<input type=checkbox name=ckbox>
  110. <br>8<input type=checkbox name=ckbox>
  111. <br>9<input type=checkbox name=ckbox>
  112. <p><input type=button value="Count Checkboxes" onClick="anyCheck(this.form)">
  113. </form>
  114.  
  115. <!-- END OF SCRIPT -->
  116. <!/PREVIEW>
  117.  
  118. <!RELATED>NONE<!/RELATED>
  119.